package leetCode.offer17;

import java.util.Arrays;

public class Solution2 implements Solution{
    @Override
    public int[] printNumbers(int n) {
        if(n==0) return new int[0];
        int num = 9;
        for(int i=1;i<n;i++) {
            num = num*10+9;
        }
        int[] result = new int[num];
        for(int i=0;i<num;i++){
            result[i] = i+1;
        }
        return result;
    }

    public static void main(String[] args) {
        Solution s = new Solution2();
        for(int i=0;i<3;i++){
            System.out.println(Arrays.toString(s.printNumbers(i)));
        }
    }


}
